package com.bpf.base.base.vo;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class TreeNode {

	private String id; // 要显示的子节点的ID
	private String text; // 要显示的子节点的 Text
	private String iconCls; // 节点的图标
	private String parentId; // 父节点的ID
	private List<TreeNode> children; // 孩子节点的List
	private String state;
	private String subText;
	private String treeCode;
	private Date time;
	
	public TreeNode() {
	}

	public TreeNode(String id, String text, String iconCls, String parentId,

	List<TreeNode> children) {

		super();
		this.id = id;
		this.text = text;
		this.iconCls = iconCls;
		this.parentId = parentId;
		this.children = children;
	}

	public String getId() {

		return id;

	}

	public void setId(String id) {
		this.id = id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getIconCls() {
		return iconCls;
	}

	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public List<TreeNode> getChildren() {
		return children;
	}

	public void setChildren(List<TreeNode> children) {
		this.children = children;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	public String getSubText() {
		return subText;
	}

	public void setSubText(String subText) {
		this.subText = subText;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getTreeCode() {
		return treeCode;
	}

	public void setTreeCode(String treeCode) {
		this.treeCode = treeCode;
	}

	// 添加子节点的方法
	public void addChild(TreeNode node) {
		if (this.children == null) {
			children = new ArrayList<TreeNode>();
			children.add(node);
		} else {
			children.add(node);
		}

	}

}